package com.ceo.common.http.exception;

/**
 * @author uto_dev_008
 * @desc
 * @since 2021/11/22 15:42
 * Copyright (c)  All rights reserved
 */
public abstract class AbstractApiException extends RuntimeException {

    private final Object data;
    private final int code;
    private final boolean i18;

    public AbstractApiException(String message, int code, boolean i18) {
        super(message);
        this.i18 = i18;
        this.data = null;
        this.code = code;
    }

    public AbstractApiException(String message, int code, Throwable throwable, boolean i18) {
        super(message, throwable);
        this.i18 = i18;
        this.data = null;
        this.code = code;
    }

    public AbstractApiException(Object data, String message, int code, boolean i18) {
        super(message);
        this.data = data;
        this.code = code;
        this.i18 = i18;
    }

    public AbstractApiException(Object data, String message, int code, Throwable throwable, boolean i18) {
        super(message, throwable);
        this.data = data;
        this.code = code;
        this.i18 = i18;
    }

    public Object getData() {
        return data;
    }

    public int getCode() {
        return code;
    }

    public boolean isI18() {
        return i18;
    }
}
